package com.zch.news.service.impl;

import java.util.List;

import com.zch.news.dao.NewsDao;
import com.zch.news.dao.impl.NewsDaoImpl;
import com.zch.news.entity.News;
import com.zch.news.service.NewsService;

public class NewsServiceImpl implements NewsService {

	//初始化一个NewsDao对象
	NewsDao newsDao = new NewsDaoImpl();
	@Override
	public boolean addNews(News news) {
		return newsDao.addNews(news);
	}

	@Override
	public boolean deleteNews(int no) {
		return newsDao.deleteNews(no);
	}

	@Override
	public boolean updateNews(News news) {
		return newsDao.updateNews(news);
	}

	@Override
	public List<News> getAllNews() {
		return newsDao.getAllNews();
	}

	@Override
	public News getNewsByNo(int no) {
		return newsDao.getNewsByNo(no);
	}

}
